﻿/**
* Vista asociada al contenido 
* del tab de la funcionalidad DETALLE DEL PROYECTO
* en el aplicativo.
*/
Ext.define("entgpv11.view.details.NoteEditor", {
    extend: "Ext.form.Panel",
    requires: "Ext.form.FieldSet",
    alias: "widget.noteeditor",
    config: 
    {
        fullscreen: true,
	    flex: 1,
        scrollable: 'vertical',
		data:null
    },
    initialize: function () {

        this.callParent(arguments);
       	
        //[{"Id":2,"Nombre":"Agua Potable Santa Clara","FechaInicio":"\/Date(1260766800000)\/","FechaFin":"\/Date(1263013200000)\/","Presupuesto":0,"Latitud":-386,"Longitud":-787,"Viabilidad":"SI","Dictamen":"SI","Descripcion":"Agua Potable Santa Clara","Saldo":122681,"UltimoPago":1,"AportePlan":122684,"AportePlanConDescuento":122684,"PorcentajeAvance":0,"Estado":279,"Tipo":270,"NumeroDias":0,"PoblacionAfectada":606,"NumeroHabitantes":0,"IsBusy":false,"IsSelfBusy":false},{"Id":3,"Nombre":"Agua Potable-Palanda.PucarÃ³n","FechaInicio":"\/Date(1219554000000)\/","FechaFin":"\/Date(1277874000000)\/","Presupuesto":67627.01,"Latitud":-3.248839,"Longitud":-79.961243,"Viabilidad":"SI","Dictamen":"SI","Descripcion":"Sistema de Agua Potable del Barrio PucarÃ³n","Saldo":49705.85,"UltimoPago":0,"AportePlan":49705.85,"AportePlanConDescuento":49705.85,"PorcentajeAvance":100,"Estado":277,"Tipo":270,"NumeroDias":0,"PoblacionAfectada":607,"NumeroHabitantes":0,"IsBusy":false,"IsSelfBusy":false}]
	   var noteTitleEditor = {
            xtype: 'textareafield',
            name: 'Nombre',
            label: 'Nombre',
            minHeight:'20%',
            readOnly: true
        };
        var noteNarrativeEditor = {
            xtype: 'textareafield',
            name: 'Descripcion',
            minHeight:'70%',
            label: 'Detalle',
            readOnly: true
        };
        var noteFechaEditor = {
            xtype: 'datepickerfield',
            name: 'FechaInicio',
            label: 'Fecha Inicio',
            readOnly: true
        };
        var noteFechaFinEditor = {
            xtype: 'datepickerfield',
            name: 'FechaFin',
            label: 'Fecha Finalizar',
            readOnly: true
        };
        var noteSaldoEditor = {
            xtype: 'textfield',
            name: 'Saldo',
            label: 'Saldo',
            readOnly: true
        };
       
        var notePorcentajeEditor = {
            xtype: 'textfield',
            name: 'PorcentajeAvance',
            label: '% Avance',
            readOnly: true
        };
      	var noteNumeroDiasEditor = {
            xtype: 'textfield',
            name: ' NumeroDias',
            label: 'Días',
            readOnly: true
        };
        var notePoblacionAfectadaEditor = {
            xtype: 'textfield',
            name: 'PoblacionAfectada',
            label: 'Población Afectada',
            readOnly: true
        };
         var noteNumeroHabitantesEditor = {
            xtype: 'textfield',
            name: 'NumeroHabitantes',
            label: 'Habitantes',
            readOnly: true
        };
       
        this.imageView = 
		{
           xtype: 'image',
		   src:'resources/images/var/myfooter.png',
		   flex:'1'
        };
		var lblInfoResource ={
			xtype: 'fieldset',
			title: 'Inicio',
			instructions: 'Service Project',
		};
		
		//noteFechaEditor,noteFechaFinEditor,notePorcentajeEditor
        this.add([
            {
                            xtype: 'toolbar',
                            docked: 'top',
                            ui: 'sub',
                            title: 'Detalles',
                            items: [

                                          { xtype: 'spacer' }

                                   ]
            },
		    { 
			    xtype: "fieldset",
                defaults: {
                            labelWidth: '35%'
                        },
               
                items: [
                    noteTitleEditor, noteNarrativeEditor
                ]
            },
             { 
			    xtype: "fieldset",
                defaults: {
                            labelWidth: '35%'
                        },
                title: '',
                items: [
                    noteSaldoEditor, noteNumeroDiasEditor,notePoblacionAfectadaEditor,
                    noteNumeroHabitantesEditor
                ]
            },
            { xtype: 'spacer' }
          
        ]);
    }
});

